
const Koa = require('koa');
const app = new Koa();
const bodyParser = require('koa-bodyparser');
const json = require('koa-json');
const cors = require('koa2-cors');
const users = require('./routers/manage/user');
const goods = require('./routers/manage/goods');
const wxGoods = require('./routers/miniapps/goods');
const order = require('./routers/manage/order');
const wxorder = require('./routers/miniapps/order');
const member = require('./routers/miniapps/member');
const manageMember = require('./routers/manage/member');
const gem = require('./routers/gem/gem');
const card = require('./routers/miniapps/card');

app.use(cors());
app.use(bodyParser())
app.use(json())
app.use(users.routes(), users.allowedMethods())
app.use(goods.routes(), goods.allowedMethods())
app.use(wxGoods.routes(), wxGoods.allowedMethods())
app.use(order.routes(), order.allowedMethods());
app.use(wxorder.routes(), wxorder.allowedMethods());
app.use(member.routes(), member.allowedMethods());
app.use(manageMember.routes(), manageMember.allowedMethods());
app.use(gem.routes(), gem.allowedMethods())
app.use(card.routes(), card.allowedMethods())

app.listen(3001);


